<template>
  <div>
    <h2>申请贷款</h2>
    <el-form ref="form" :model="form" :rules="rules" label-width="80px">
      <el-form-item label="租房合同编号" prop="merchantName">
        <el-input v-model="form.merchantName" placeholder="租房合同编号"/>
        <el-button>租房合同查询</el-button>
      </el-form-item>
      <el-form-item label="房源编号" prop="tenantName">
        <el-input v-model="form.tenantName" placeholder="房源编号"/>
        <el-button>房源编号查询</el-button>
      </el-form-item>
      <el-form-item label="租客姓名" prop="legalPerson">
        <el-input v-model="form.legalPerson" placeholder="租客姓名"/>
      </el-form-item>
      <el-form-item label="租客电话" prop="address">
        <el-input v-model="form.address" placeholder="租客电话"/>
      </el-form-item>
      <el-form-item label="租客身份证号" prop="idCard">
        <el-input v-model="form.idCard" placeholder="租客省份证号"/>
      </el-form-item>
      <el-form-item label="金融产品选择" prop="idCard">
        <el-input v-model="form.idCard" placeholder="金融产品选择"/>
      </el-form-item>
      <el-form-item label="借款金额" prop="license">
        <el-input v-model="form.license" placeholder="借款金额"/>
      </el-form-item>
      <el-form-item label="借款期限/月" prop="ownership">
        <el-input v-model="form.ownership" placeholder="借款期限"/>
      </el-form-item>
      <el-form-item label="公寓承担" prop="userId">
        <el-input v-model="form.userId" placeholder="0"/>
        %
      </el-form-item>
      <el-form-item label="租客承担" prop="userId">
        <el-input v-model="form.userId" placeholder="0"/>
        %
      </el-form-item>
      <el-form-item label="年利率" prop="userId">
        <el-input v-model="form.userId" placeholder="0"/>
        %
      </el-form-item>
      <el-form-item label="年一次性服务费率" prop="userId">
        <el-input v-model="form.userId" placeholder="0"/>
        %
      </el-form-item>
      <el-form-item label="授信额度" prop="userId">
        <el-input v-model="form.userId" placeholder="0"/>
        %
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button type="primary" @click="reset">取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  // 申请贷款
  name: 'ApplyLoan',
  data () {
    return {
      listCity: [],
      form: {
        merchantName: null,
        tenantName: null,
        legalPerson: null,
        citys: [],
        regionId1: null,
        regionId2: null,
        regionId3: null,
        address: null,
        status: 0,
        unifyCode: null,
        idCard: null,
        license: null,
        ownership: null,
        createTime: null,
        userId: null
      },
      // 表单校验
      rules: {}
    }
  },
  created () {
  },
  methods: {
    // 表单重置
    reset () {
      this.form = {
        id: null,
        merchantName: null,
        tenantName: null,
        legalPerson: null,
        regionId1: null,
        regionId2: null,
        regionId3: null,
        address: null,
        status: 0,
        unifyCode: null,
        idCard: null,
        license: null,
        ownership: null,
        createTime: null,
        userId: null
      }
    },
    // 多选框选中数据
    handleSelectionChange (selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 修改按钮操作 */
    handleUpdate (row) {
      this.reset()
    },
    /** 提交按钮 */
    submitForm () {
      this.$refs.form.validate(valid => {
        if (valid) {
          return null
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
